<extend name="Base:base" />
<block name="base_main">
	<link rel="stylesheet" href="__PUBLIC__/seller/css/validform.css" />
	<script src="__PUBLIC__/seller/js/Validform_v5.3.2.js"></script>
	<style>
		body{ background:#fff }
		dt+dd { margin:0px; padding:0px; }
		.supply_info{ width:100%; font-size:14px;}
		.supply_info dl{ width:100%; }
		.supply_info dl dt,.supply_info dl dd{ float:left }
		.fieldset_list{ width:100%; border:1px solid #ccc; }
		.fieldset_list legend{ border:1px solid #ccc;  font-size:14px; margin:0px; padding:5px 14px; width:auto !important;}
		[class*=am-u-]{ padding:0px !important }
		.fieldset_list .supply_info { width:90%; margin:0px 5%;}
		.fieldset_list .supply_info dl { width:50%; float:Left; margin:0px; line-height:30px; font-size:14px;}
		.fieldset_list .supply_info dl dt{ width:90px; }
	</style>
	<div class="tpl-block ">
		<div class="am-g tpl-amazeui-form">
			<div class="am-u-sm-12 am-u-md-12">
				<form class="am-form am-form-horizontal" request_type="parent" action="" name="myfromSubmit" method="post">
					<div class="am-form-group">
						<div class="am-u-sm-12">
							<fieldset class="fieldset_list">
								<legend>供应信息</legend>
								<div class="supply_info">
                                	<dl style="width:100%;">
										<dt>商品名称：</dt>
										<dd>{$info.name}</dd>
									</dl>
                                    <dl style="width:100%;">
										<dt>EN13码：</dt>
										<dd>{$info.earn13}</dd>
									</dl>
									<dl style="width:100%;">
										<dt>供应商：</dt>
										<dd>{$info.shop_name}</dd>
									</dl>
                                    <dl>
										<dt>市场价：</dt>
										<dd>{$info.market_price}</dd>
									</dl>
                                    <dl>
										<dt>建议销售价：</dt>
										<dd>{$info.price}</dd>
									</dl>
                                    <dl>
										<dt>锁货价：</dt>
										<dd>{$info.lock_price} （最低锁货量：<span style="color:red; font-weight:bold;">{$info.lock_start_num}</span>）</dd>
									</dl>
                                    <dl>
										<dt>库存：</dt>
										<dd>{$info.stock_num}</dd>
									</dl>
                                    <dl>
										<dt>库存位置：</dt>
										<dd><eq name="info.stock_status" value="1"><span style="color:green">在仓库</span><else /><span style="color:red">运送途中</span></eq></dd>
									</dl>
                                    <dl>
										<dt>到货时间：</dt>
										<dd><eq name="info.stock_status" value="1">已到达<else />{:date('Y-m-d' , $info['stock_arrive_time'])}</eq></dd>
									</dl>
								</div>
							</fieldset>
                            <fieldset class="fieldset_list">
								<legend>分销信息</legend>
								<div class="supply_info">
                                    <dl style=" margin-top:8px;width:100%; ">
										<dt>分销模式：</dt>
										<dd>库存锁库</dd>
									</dl>
									<dl>
										<dt>市场价：</dt>
										<dd><input type="text" value="{$info.market_price}" name="market_price" id="market_price" onblur="re=/^[0-9]+(\.[0-9]{1,2})?$/g;if( !re.test( this.value ) ) { this.value='1.00'; }" style="width:80px; padding:4px 8px;" value=""/></dd>
									</dl>
                                    <dl>
										<dt>分销零售价：</dt>
										<dd><input type="text" value="{$info.price}" name="price" id="price" onblur="re=/^[0-9]+(\.[0-9]{1,2})?$/g;if( !re.test( this.value ) ) { this.value='1.00'; }" style="width:80px; padding:4px 8px;" value=""/></dd>
									</dl>
									<dl style="width:100%; margin-top:10px;">
										<dt>锁定库存：</dt>
										<dd><input type="text" name="stock_num" id="stock_num" onblur="re=/^[0-9]+$/g;if( !re.test( this.value ) || (this.value > {$info.stock_num} ||{$info.lock_start_num} > this.value ) ) { this.value='{$info.lock_start_num}'; }" style="width:80px; padding:4px 8px;" value="{$info.lock_start_num}"/> <span style="color:red">注意：锁货区间{$info.lock_start_num} 到 {$info.stock_num}</dd>
									</dl>
								</div>
							</fieldset>
						</div>
					</div>

					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
                        	<input type="hidden" value="{$info.id}" name="supply_id" />
                            <eq name="info.stock_num" value="0">
							<button type="button" class="am-btn">供应商暂时没有库存，不能锁定</button>
                            <else/>
							<button type="submit" class="am-btn am-btn-primary">确认一键锁定</button>
                            </eq>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
	<script>
		call_submit_back_flag = true;
		function call_submit_back_func() {
			parent.zeroModal.closeAll();
		}
		obj_position = 'parent';
		$('.am-btn-primary').click(function(){
				if( $('#market_price').val() == '' ) {
						error('市场价不能为空');
						return false;
				}
				if( $('#price').val() == '' ) {
						error('分销价格不能为空');
						return false;
				}
		});
		
	</script>
</block>